/*
 *  tropeTypes.h
 *  tropeProject
 *
 *  Created by Jared Schiffman on 12/5/10.
 *  Copyright 2010. All rights reserved.
 *
 */

#include <string>
#include <vector>

enum tropeMetaType { TROPE_BUILT_IN_TYPE, TROPE_USER_TYPE, TROPE_FUNCTION_TYPE, TROPE_TYPE_TYPE };

typedef int tropeTypeID;

class tropeMethodDeclarationNode;
class tropeVariableDeclarationNode;

class tropeType
{
public:
	tropeType( std::string _name, tropeMetaType	_metaType, tropeTypeID _parentTypeID );
	
	std::string			name;
	tropeMetaType		metaType;
	tropeTypeID			parentTypeID;
	tropeTypeID			typeID;
	
	// class method and class variable lists
	std::vector<tropeMethodDeclarationNode*>	methodList;
	std::vector<tropeVariableDeclarationNode*>	variableList;
	
	// master list of types and methods to access them
	static tropeType*							getType( std::string typeName );
	static tropeType*							getType( tropeTypeID ID );
	static tropeTypeID							getTypeID( std::string typeName );
	static int									registerType( tropeType* T );
	static void									makeBaseTypes();
	static std::vector<tropeType*>				masterTypeList;
};


#define TROPE_NULL_TYPE 0
#define TROPE_BOOLEAN_TYPE 1


